//
//  HEBaseViewController.m
//  huien
//
//  Created by yiban on 2017/5/26.
//  Copyright © 2017年 lcb. All rights reserved.
//

#import "HEBaseViewController.h"

@interface HEBaseViewController ()
@property(nonatomic,strong) UIButton *backButton;
@property(nonatomic,strong) UILabel *titleLabel;
@end

@implementation HEBaseViewController
@synthesize headerView=_headerView;
@synthesize navTitle=_navTitle;

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=[UIColor whiteColor];
    self.navigationController.navigationBarHidden=YES;
//    self.fd_prefersNavigationBarHidden = YES;
    
    [self initNavView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)initNavView
{
    if (_headerView) {
        [_headerView removeAllSubviews];
        [_headerView removeFromSuperview];
        _headerView=nil;
    }
    _headerView =[[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, YB_HeaderHeight)];
    _headerView.backgroundColor=UIColorFromRGB(0xffffff);//UIColorFromRGB(0x00a5ed);
    [self.view addSubview:_headerView];
    //
    _titleLabel =[[UILabel alloc] initWithFrame:CGRectMake(30, 20+(YB_HeaderHeight-20-20)/2, SCREEN_WIDTH-60, 20)];
    _titleLabel.backgroundColor = [UIColor clearColor];
    _titleLabel.textColor = UIColorFromRGB(0x9e9e9e);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.font = [UIFont boldSystemFontOfSize:18];
    [_headerView addSubview:_titleLabel];
    UIView *bView =[[UIView alloc] initWithFrame:CGRectMake(0, _headerView.frame.size.height-1, SCREEN_WIDTH, 1)];
    bView.backgroundColor=UIColorFromRGB(0xeff2f2);
    [_headerView addSubview:bView];
    
}
-(void)setNavTitle:(NSString *)navTitle
{
    _navTitle=navTitle;
    _titleLabel.text=navTitle;
}

@end
